[//

    async function( kuo,Context,context){
        let LANG = this.LANG();
        let $DATA = Object.assign({},this.$DATA);
        let $hash = 'safetoken/'+kuo.adminid;
        $DATA.token = Mode("Tools").Uuid();
        await Mem.Set($hash,$DATA.token);
        let  $kongzhi = kuo.Path.length > 0?kuo.Path[kuo.Path.length-1]:"get";
        let  $db = await db('integrallog');
        let  riziname  = "integrallog";
        let  $_GET = kuo.get;
        let  $_POST = kuo.post;
        let  $chushi = true;
        if($kongzhi == 'get'){
    
            let $page = Mode("Tools").Int($_GET['page']?$_GET['page']:1);
            let $limitx  =  Mode("Tools").Int($_GET['limit']?$_GET['limit']:10);
            if($limitx < 10 ){
                $limitx = 10;
            }else if($limitx > 100 ){
                $limitx = 100;
            }
            let $where ={};
            if(isset($_GET['type']) && $_GET['type'] != ""){
                $chushi = false; 
                $where['type'] = Mode("Tools").Int($_GET['type']);
            }
            if(isset($_GET['uid']) && $_GET['uid'] != ""){
                $chushi = false; 
                $where['uid'] = Mode("Tools").Int($_GET['uid']);
            }
            if(isset($_GET['pluginid']) && $_GET['pluginid'] != ""){
                $chushi = false; 
                $where['pluginid'] = $_GET['pluginid'];
            }
           
            if(isset($_GET['ip']) && $_GET['ip'] != ""){
                $chushi = false; 
                $where['ip'] = $_GET['ip'];
            }
        
            if(isset($_GET['atimestart']) && $_GET['atimestart'] != ""){
                $chushi = false; 
                $where['atime >'] =strtotime($_GET['atimestart']);
            }
        
            if(isset($_GET['atimeend']) && $_GET['atimeend'] != ""){
                $chushi = false; 
                $where['atime <'] =strtotime($_GET['atimeend']);
            }
            if(isset($_GET['shuaxin']) && $_GET['shuaxin'] != ""){
                $chushi = false; 
            }
            let $data  = await $db.Where($where).Limit($limitx,$page).Order("id desc").Select();
            let $total = await $db.Where($where).Total();
            if(!$data){
                $data= [];
            }else{
                let $huancong = {};
                for( let $k in $data ){
                    let $v = $data[$k];
                    if(! isset( $huancong[$v['pluginid']] )){
                        let $fan = await Kuoplus($v['pluginid']);
                      
                        if($fan &&  $fan['configure'][riziname]){
                            $huancong[$v['pluginid']] =  $fan['configure'][riziname];
                        }else{
                            $huancong[$v['pluginid']] = [];
                        }
                    }
                    let $typename = "";
                    if(isset($huancong[$v['pluginid']][$v['type']] )){
                        $typename =  $huancong[$v['pluginid']][$v['type']];
                    }else{
                        $typename = $v['type'];
                    }
                    $data[$k]['typename'] = $typename;
                }
            }
            $DATA.code = 0;
            $DATA.count = $total;
            if($page == 1 && $chushi){
                $DATA.diyici = 1;
            }
            $DATA.data = $data;
        }else if($kongzhi == 'put'){
           
        }else if($kongzhi == 'add'){

            let $key = Mode("Tools").Xss($_POST['key']);
            let $fan = await Kuoplus($key);
           
            if($fan){
                let $data = $fan['configure'][riziname];
                if($data){
                    $DATA.code = 1;
                    $DATA.data =  $data;
                }
            }

        }else if($kongzhi == 'del'){
    
        }
        Context.body = JSON.stringify($DATA);
    }
    
]